package com.yhsoft.sys.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yhsoft.sys.controller.Response.UserInfoListOutVo;
import com.yhsoft.sys.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yyyyyyyh
 * @since 2023-08-30
 */
public interface UserMapper extends BaseMapper<User> {

    public List<String> getRoleNameByUserId(String userId);

//    @Select("SELECT   " +
//            "   *    " +
//            "FROM   " +
//            "   (   " +
//            "   SELECT   " +
//            "      a.company_id AS company_id,   " +
//            "      a.id AS id,   " +
//            "      a.phone AS phone,   " +
//            "      a.username AS username,   " +
//            "      a.create_time AS create_time,   " +
//            "      b.role_id AS role_id,   " +
//            "      c.role_name  AS role_name " +
//            "   FROM   " +
//            "      x_user a   " +
//            "      LEFT JOIN x_user_role b ON a.id = b.user_id   " +
//            "      LEFT JOIN x_role c ON b.role_id = c.role_id    " +
//            "   ) AS invo "
//            + " ${ew.customSqlSegment}")
    IPage<UserInfoListOutVo> getListPageByConditions(IPage<UserInfoListOutVo> pageDtoIPage, @Param("ew") Wrapper wrapper);

    IPage<UserInfoListOutVo> getUserListPageByConditions(IPage<UserInfoListOutVo> pageDtoIPage, @Param("ew") Wrapper wrapper);
}
